<?php
namespace classes;
require_once 'Mysql.class.php';
/**
 * 针对任何数据表操作的基类
 */
abstract class Table{
	protected $table;
	protected $db;
	protected static $_db;
	//$config:存储数据库的配置信息
	public function __construct(){
		$this->table = get_class($this);
		$this->db = self::$_db;		
	}
	public static function setDefaultDb($db){
		self::$_db = $db;
	}
	public function insert($bind){
		return $this->db->insert($this->table,$bind);
	}	
	public function delete($where=null){
		return $this->db->delete($this->table,$where);
	}
	public function update($bind,$where=null){
		return $this->db->update($this->table,$bind,$where);
	}
	
}